

let fir=document.querySelector('.fir')
let userId=fir.getAttribute('userId')
let outbox=document.querySelector('.outbox')
let  fans1=document.getElementsByClassName('fans1')[0]
let fans2=document.getElementsByClassName('fans2')[0]


 //返回帖子总数
 function gettieziNums(pageNum){
     return new Promise((resolve,reject)=>{
         axios({
             url:'/alltiezi',
             method:'get',
             params:{
                pageNum: pageNum||1,
                pageSize: 6,
                userId:userId
}
         }).then(data=>{
             console.log(data);
          let message=data.data.data.data
          console.log(message);
         
             resolve(message)
         }).catch(err=>{
             console.log(err);
             reject(err)
             alert('no')
         })
     })

 }

 //便历图片信息
 let pagenow=1
 function  bianliTiezi(pagenow){
    gettieziNums(pagenow).then(data=>{
     if(data==null){
         outbox.innerHTML=`<span>暂时没有帖子！</span>`
     }else{
       if(data.length==0){
     outbox.innerHTML=`<span>暂时没有帖子！</span>`}
     else{
        for(i=0;i<data.length;i++){
            outbox.innerHTML+=`<div class='num1'>
            <div class="toppic"><img src='${data[i].path}'></div>
            <div class="middle">
                <span id='spanleft'><img src='${data[i].portrait}'></span>
                <span  id='spanright'><a href='/album/tiezi?id=${data[i].id}'>${data[i].name}</span>
                </div>
            <div class="bottom">${data[i].time}</div>
        </div>`

        }
        // let node=outbox.lastElementChild
        // console.log(node);

     }
     }
    })


 }
 bianliTiezi()


 //查看关注数量
 function getconcerns(){
    axios({
        url:''
    })
}
